<div id="tabs">
	<ul>
        <li><?php echo $this->Html->link(__('Báo cáo ngày', true),  array('controller'=>'kqbanhangs','action'=>'kqbhngaynv',$this->Session->read('cur_dv'),$this->Session->read('cur_manv')));?></li>
        <li><?php echo $this->Html->link(__('Báo cáo tuần', true), array('controller'=>'kqbanhangs','action'=>'kqbhtuannv',$this->Session->read('cur_dv'),$this->Session->read('cur_manv')));?></li>
        <li id="current"><?php echo $this->Html->link(__('Báo cáo tháng', true),  array('controller'=>'kqbanhangs','action'=>'kqbhthangnv',$this->Session->read('cur_dv'),$this->Session->read('cur_manv')));?></li>
        <li><?php echo $this->Html->link(__('Chỉ tiêu SXKD lũy kế', true),  array('controller'=>'kqbanhangs','action'=>'luyke',$this->Session->read('cur_manv')));?></li>
	   <li><?php echo $this->Html->link(__('Danh sách nhân viên', true),  array('controller'=>'nhanviens','action'=>'kqbanhang',$this->Session->read('cur_dv')));?></li>
    </ul>
</div>
<?php
echo $form->create('Kqbanhang');?>
<h2>Vui lòng chọn nhân viên tháng muốn xem kết quả bán hàng</h2>
<table border = 0>
<tr>
<td  colspan=2><?php echo $form->input('nhanvien',array('id'=>'nhanvien','label'=>'Nhân Viên','options'=>$nhanvien,'empty'=>"Chọn Nhân Viên",'selected'=>$nhanvien_id))?></td>
</tr>
<tr>
<td>
<?php
	if(empty($nams))
		$nams =array(); 
 echo $form->input('nam',array('id'=>'nam','label'=>'Năm','options'=>$nams,'empty'=>"Chọn Năm"));//,'selected'=>date('Y')?>
</td>
<td>
<div id=thang>
<?php echo $form->input('thang',array('id'=>'thang','label'=>'Tháng','options'=>$thoigian,'empty'=>"Chọn Tháng"));?>
</div>
</td>
</tr>
<tr>
<td colspan=2 align="center">
<?php 
echo $js->submit('Xem', array(
								'url'=> array('controller'=>'kqbanhangs', 'action'=>'laykqbh'),
 								'update' => '#kq'));
?>
</td>
</tr>
</table>
<div  id='kq'></div>
<?php
$this->Js->get('#nhanvien')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'laythang'),
								array('update' => '#thang','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)))));
$this->Js->get('#nhanvien')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'emptykq'),
								array('update' => '#kq','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)))));

$this->Js->get('#nam')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'laythang'),
								array('update' => '#thang','async' =>true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)))));
								
								
/*$this->Js->get('#thang')->event('change',
								$this->Js->request(array('controller' => 'kqbanhangs', 'action' => 'laykqbh',$nhanvien_id),
								array('update' => '#kq','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => false, 'inline' => true)))));
*/echo $form->end();
?>